package bitmapdata
{
	import flash.display.Sprite;
	import flash.geom.Point;
	
	public class TestPaletteMap extends Sprite
	{
		private var arr:Array;
		public function TestPaletteMap()
		{
			arr = new Array();
			this.graphics.beginFill(0xfff000);
			this.graphics.lineStyle(1);
			this.graphics.moveTo(0,100);
			drawBzl(new Point(0,100),new Point(200,200),new Point(100,0));
			this.graphics.moveTo(0,102);
			drawBzl(new Point(0,103),new Point(200,203),new Point(97,0));
			this.graphics.moveTo(0,100);
			this.graphics.lineTo(0,103);
//			this.graphics.endFill();
		}
		
		public function drawBzl(p0:Point,p1:Point,p2:Point):void {
			for (var t:Number = 0; t < 1; t += 1/(p1.x-p0 .x)) {
				var posX:Number = Math.pow(1 - t, 2) * p0.x + 2 * t * (1 - t) * p2.x + Math.pow(t, 2) * p1.x;
				var posY:Number = Math.pow(1 - t, 2) * p0.y + 2 * t * (1 - t) * p2.y + Math.pow(t, 2) * p1.y;
				this.graphics.lineTo(posX,posY);
				arr.push(new Point(posX,posY));
			}
			trace(arr);
		}
	}
}